const prefix = '';
const suffix = '.do';

const urlMap = {
    'dev': {
        // Common Controller
        '获取国家区号列表(未登入)': '/regionNumberList',

        // Main Controller
        '首页': '/userMain',

        // Trade Order Controller
        '主扫支付(获取参数 + 支付密码)': '/scanCodePay',
        '订单详情': '/tradeOrder',

        // User Controller
        '校验交易密码': '/user/checkFundPwd',
        '校验账号是否重复': '/user/checkLoginIdDuplication',
        '验证码验证': '/user/checkVerifyCode',
        '修改登入密码(已登入)': '/user/loggedInRePwd',
        '修改登入密码(已登入) 通过手机验证码': '/user/loggedInVerifyRePwd',
        '修改登入密码(未登入)': '/user/notLoggedInRePwd',
        '修改登入密码(未登入) 通过手机验证码': '/user/notLoggedInVerifyRePwd',
        '修改交易密码(已登入)': '/user/reFundPwd',
        '刷新密钥(已登入)': '/user/refreshToken',
        '修改交易密码时(已登入) 发送验证码': '/user/sendCodeForReFundPwd',
        '修改登入密码时(未登入) 发送验证码': '/user/sendCodeForRePwd',
        '注册用户时发送验证码': '/user/sendCodeForSignup',
        '登入': '/user/sign',
        '注册用户': '/user/signup',
        '上传/更新 个人头像': '/user/updateImage',
        '上传/更新 个人头像2': '/user/updateImage2',
        '个人中心[Web前端专用]': '/user/userInfo',
        '[设置交易密码/重置交易密码](已登入) 通过手机验证码': '/user/verifyReFundPwd',

        // User Fund Record Controller
        '我的资产列表': '/userFundRecordList',

        // User Notice Controller
        '消息详情': '/userNotice',
        '消息列表': '/userNoticeList',

        // User Transaction Controller
        '转账请求': '/requestUserTransactionForWithdrawal',
        '转账详情': '/userTransaction',
        '转账列表': '/userTransactionMobileList',

        // User Wallet Controller
        '获取当前币名称 余额,转账手续费 等信息': '/getUserWalletBalanceForWithdrawal',
        '获取币提现(余额,费率等)': '/getUserWalletBalanceForWithdrawalCash',
        '获取当前用户余额': '/userWalletBalance',

        // User Withdrawal Address Controller
        '用户创建转账地址': '/createUserWithdrawalAddress',
        '用户删除转账地址': '/deleteUserWithdrawalAddress',
        '用户编辑转账地址': '/updateUserWithdrawalAddress',
        '判断地址是否为 平台内/外部': '/userCheckAddressTypeUserWithdrawalAddress',
        '获取转账地址列表': '/userWithdrawalAddressMobileList',

        // User Withdrawal Bank Controller
        '创建银行': '/createUserWithdrawalBank',
        '删除银行': '/deleteUserWithdrawalBank',
        '修改银行': '/updateUserWithdrawalBank',
        '查询银行详情': '/userWithdrawalBank',
        '银行列表': '/userWithdrawalBankList',

        // User Withdrawal Cash Controller
        '个人取消提现': '/cancelUserWithdrawalCash',
        '个人提现请求': '/requestUserWithdrawalCash',
        '个人提现详情页': '/userWithdrawalCash',
        '个人提现列表': '/userWithdrawalCashList',

        // User Recharge Controller
        '平台收款银行账号列表': '/masterBankList',
        '用户充值记录列表': '/userRechargeRecordList',
        '用户充值获取信息': '/verifyCodeOfRechargeForWeb',
        '重新获取关联码': '/newVerifyCodeOfRecharge',
        '创建充值订单': ' /saveUserRechargeRecord',
        '创建异常充值订单': '/saveUnusualUserRechargeRecord',
        '充值记录详情': '/userRechargeRecord',
        '用户充值规则': '/userRechargeInstruction',
    },
};

export const urlService = (type: string, key: string) => {
    const url = urlMap[type][key];
    if (url) {
        return prefix + urlMap[type][key] + suffix;
    } else {
        throw Error(`fail to find url: ${key}`);
    }
};

